Array.prototype.getSum = function () {
  function callback(sum, elem) {
    return sum + elem
  }
  return this.reduce(callback, 0)
}

var arr = [1, 2, 3]
var res = arr.getSum()
console.log(res)
